//
//  TurnPhotoCell.m
//  JoyFulFurnishing
//
//  Created by 李书勋 on 14/12/18.
//  Copyright (c) 2014年 apple. All rights reserved.
//

#import "TurnPhotoCell.h"

@interface TurnPhotoCell () <UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout>

@end
@implementation TurnPhotoCell

- (void)awakeFromNib {
    // Initialization code
    self.backgroundColor = [UIColor cyanColor];
     UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.itemSize = CGSizeMake(375, 200);
    flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    
    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:flowLayout];
    collectionView.dataSource = self;
    collectionView.delegate = self;
    [self addSubview:collectionView];
    [collectionView release];
    [flowLayout release];
    
    
    [collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"reuse"];
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 5;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"reuse" forIndexPath:indexPath];
    //    系统提供的cell没有任何自带的控件 完全需要我们自定义
    cell.contentView.backgroundColor = [UIColor cyanColor];
    return cell;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)layoutSubviews
{
    [super layoutSubviews];
}
@end
